package com.wiscamp.ninechapters.problems.infrastructure.converters;

import com.wiscamp.ninechapters.problems.domain.models.sheets.Sheet;
import com.wiscamp.ninechapters.problems.domain.models.sheets.SheetDetail;
import com.wiscamp.ninechapters.problems.domain.models.sheets.SheetAnswer;
import com.wiscamp.ninechapters.problems.infrastructure.po.sheets.SheetAnswerPO;
import com.wiscamp.ninechapters.problems.infrastructure.po.sheets.SheetDetailPO;
import com.wiscamp.ninechapters.problems.infrastructure.po.sheets.SheetPO;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface SheetConverter {
    SheetConverter Instance = Mappers.getMapper(SheetConverter.class);

    // region sheet
    SheetPO toSheetPO(Sheet entity);

    SheetPO toSheetPO(Sheet entity, @MappingTarget SheetPO po);

    Sheet toSheet(SheetPO po);
    // endregion


    // region sheet detail
    SheetDetailPO toSheetDetailPO(SheetDetail entity);

    SheetDetailPO toSheetDetailPO(SheetDetail entity, @MappingTarget SheetDetailPO po);

    SheetDetail toSheetDetail(SheetDetailPO po);

    // endregion

    // region sheet text extension
    SheetAnswerPO toSheetAnswerPO(SheetAnswer entity);

    SheetAnswerPO toSheetAnswerPO(SheetAnswer entity, @MappingTarget SheetAnswerPO po);

    SheetAnswer toSheetAnswer(SheetAnswerPO po);
    // endregion


}
